package com.bizdroid.unutturma.utility;

import java.util.ArrayList;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.bizdroid.unutturma.R;
import com.bizdroid.unutturma.model.ReminderItem;

public class ReminderAdapter extends BaseAdapter {

	private ArrayList<ReminderItem> items;
	private Context context;

	public ReminderAdapter(ArrayList<ReminderItem> items, Context context) {
		this.items = items;
		this.context = context;
	}

	public int getCount() {
		return items.size();
	}

	public Object getItem(int position) {
		return items.get(position);
	}

	public long getItemId(int position) {
		return position;
	}

	public View getView(int position, View convertView, ViewGroup parentView) {
		LayoutInflater inflater = LayoutInflater.from(context);
		View itemView = inflater.inflate(R.layout.simplerow, null);
		if (items != null && items.size() > 0) {

			TextView textView = (TextView) itemView
					.findViewById(R.id.simpleRow);
			// ImageView image =
			// (ImageView)itemView.findViewById(R.id.itemImage);

			// image.setImageResource(items[position].getImage());
			textView.setText(items.get(position).getRemindText());
		}

		return itemView;

	}
}
